const { createServer } = require("http");

const httpServer = createServer((request, response) => {
    
    //进行url数据的获取判断
    const url = request.url;
    const method = request.method;
    console.log('url:', url);
    if (url === '/login')
    {
        if (method !== 'POST')
        {
            response.end("登录失败");
            return;
        }
        response.end("登录成功");
        return;
    }

    response.end("hello 123");
});

httpServer.listen('8080');